/**
 * @description 右侧的属性容器
 */
import '@/style/attr.less'



/**
 * @description 默认数据
 * 1. 读取整个components目录下的数据文件
 * 2. 以文件名为key
 */
const modules = import.meta.globEager('./modules/*.jsx')
let componentMap = {}
for (const path in modules) {
  let fileName = path.split('/').pop().replace('.jsx', '')
  componentMap[fileName] = modules[path].default
}


function AttrWrapper(data) {
  let actKey = data.actKey
  let ActComponent = componentMap[actKey]
  let template2 = data[actKey]
  return (
    <ActComponent
      {...data}
      template2={template2}
    />
  )


}

export default AttrWrapper